package com.springtiles.web;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 *
 * 用spring-webmav实现restful风格 URL
 *
 * @author Jimmy.Qiu
 *
 */
@Controller
public class RestfulController {
	Logger log = LoggerFactory.getLogger(RestfulController.class);

	@RequestMapping(value = "/rest/{a}/{b}", method = RequestMethod.GET)
	public String testRest(@PathVariable("a") int a, @PathVariable("b") int b) {
		log.info("testRest a : {} b : {}", a, b);
		return "hello";
	}
}
